<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <title>创源易景大数据时空可视云平台</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <link rel="stylesheet" th:href="@{/static/login2/css/style.css}">
    <link rel="stylesheet" th:href="@{/static/login2/css/login.css}">
    <link rel="stylesheet" th:href="@{/static/login2/css/neat.css}">

</head>
<body>

<div class="wrap">
		<div class="main-container">
			<div class="logoes"><img style="width:150px;" src='../static/login2/images/logo.png' ></div>
			<h3>创源易景大数据时空可视云平台</h3>
			<form role="form"   method="post" id="loginForm">
			
			<div class="login-container">
				<span class="log-remind pd-l4 pd-b1" id="errorMsg" th:text="${message}" style="color:red"></span>
			      
				<div class="login-input"><input type="text" id="username" name="username" class="username" placeholder="用户名"><i class="username-icon"></i></div>
				<div class="login-input"><input type="password" id="password" name="password" class="password" placeholder="密码"><i class="password-icon"></i></div>
				
				<div class="login-btn-account"><a href="javascript:document:checkLogin();" >登录</a></div>
				<div class="login-btn-account"><a href="javascript:register();" >注册</a></div>
			</div>
			</form>
			<div class="copyright">
				<p>Copyright@北京集思创源科技有限公司</p>
			</div>
		</div>
	</div>
<!-- 通用js -->
<div th:include="admin/common/html/js :: onload_js"></div>
<!--样式 -->
<script type="text/javascript" th:src="@{/static/login2/js/three.min.js}" ></script>
<script type="text/javascript" th:src="@{/static/login2/js/script.js}" ></script>
<script type="text/javascript" th:src="@{/static/admin/assets/js/jquery.min.js}"></script>
<script type="text/javascript">
	
	//自适应
	changeH();
	$(window).resize(function(){
		changeH();
	});
	
	function changeH(){
		var h=window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
		$('.wrap,.main-container').css({'height':h+'px'});
		$('.main-container h3').css({'top':(h-500)/2+'px'});
		$('.main-container h4').css({'top':((h-500)/2 + 40)+'px'});
		$('.login-container').css({'top':(h-160)/2+'px'});
	}

	
    /*<![CDATA[*/
    $(function ($) {
   	 if ($(".logo").length != 0) {
   	  top.location.href = location.href;
   	 }
	   //刷新验证码
	 	$('#codeImg').click(function() {
	 		var url =  "../captcha/captchaImage?type=char&s=" + Math.random();
	 		$("#codeImg").attr("src", url);
	 	});
    });

    document.onkeydown = function login(event) {
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if (e && e.keyCode == 13) { // enter 键
            checkLogin();
        }
    };
 
    function checkLogin() {
        var username = $.trim($("#username").val());
        var password = $.trim($("#password").val());
       // var captcha = $.trim($("#yzm").val());

        if (username == "" || password == "") {
            $("#errorMsg").html("用户名或密码不能为空！");
            return false;
        }
        /* if (captcha == "") {
             $("#errorMsg").text("验证码不能为空！");
             return false;
        } */

        var dataFormJson=$("#loginForm").serialize();
		$.ajax({
			cache : true,
			type : "POST",
			url : rootPath + "/admin/login",
			data : dataFormJson,
			async : false,
			success : function(data) {
				if(data.code==200){
					window.location.href = window.rootPath+"/"+data.msg;
				}else{
					layer.msg(data.msg);
				}
			}
		}); 
        
    }
    
    
    function register(){
    	alert("待开放...");
    }

</script>

</body>
</html>